package pl.niemar22.unitests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class Gry extends SeleniumBase{
	private WebDriver driver;
	private String baseUrl="";
	private StringBuffer verificationErrors = new StringBuffer();
	@Before
	public void setUp() throws Exception {
		driver = new FirefoxDriver();
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	}

	@Test
	public void testGry() throws Exception {
		driver.get("http://www.gry-online.pl/");
		
		click(By.linkText("Drgon Commander"));
		click(By.linkText("ranking gier"));
		click(By.linkText("daty premier"));
		click(By.linkText("prasa o grach"));
		click(By.linkText("zapowiedzi"));
		click(By.linkText("PS3"));
		click(By.linkText("galerie"));
		
		insertText(By.id("searchq"), "problemkjhkjh");
		click(By.cssSelector("span.inIssueList > form > input[type=\"submit\"]"));
		driver.findElement(By.xpath("//img[@title='Silent Hill HD Collection \n ']")).click();
		driver.findElement(By.cssSelector("div.gal-c > a > img")).click();
		driver.findElement(By.linkText("zobacz całą galerię (6)")).click();
		driver.findElement(By.linkText("wiadomości")).click();
		// ERROR: Caught exception [ERROR: Unsupported command [isTextPresent]]
		// ERROR: Caught exception [ERROR: Unsupported command [isTextPresent]]
	}

	

	
}
